home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / Asymptote Demo / Asymptote Macros < prev    next >
Text File  |  1994-05-07  |  2KB  |  50 lines

  1. % Asymptote Macros
  2. %
  3. % Use this macros file to define useful, one-line command macros.
  4. % The first item in each line is the macro name.  Asymptote processes
  5. % a command macro, it replaces the macro name with the macro definition.
  6. % You can pass arguments to macros using the '&' character followed by
  7. % the argument number.
  8. %
  9. % You can specify what file you want to use for your Command Macros file
  10. % with the File>Options>Command Macros File command.
  11. %
  12. % These are some examples of the kinds of things you can do with command macros.
  13. %---------------------------------------------------------------------------------
  14. % Conversion macros:
  15. %---------------------------------------------------------------------------------
  16.  
  17. % convert the value in the X array from wavelength in microns to frequency in Hz
  18. Xµm->Hz    rpn 2.997925E14 <x / >x
  19.  
  20. % Multiply X or Y by a constant
  21. scaleX    rpn <x &1 * >x
  22. scaleY    rpn <y &1 * >y
  23.  
  24. % Convert X or Y to log values
  25. logX    rpn <x log >x
  26. logY    rpn <y log >y
  27.  
  28. %---------------------------------------------------------------------------------
  29. % 'Shorthand' macros to save typing
  30. %---------------------------------------------------------------------------------
  31.  
  32. stars    pointstyle 5 filled    % set the point style to filled stars
  33.  
  34. % These macros move the cursor to the TopLeft, BottomRight, etc. 
  35. %   corner of the graph rectangle.  You can use these to add labels
  36. %   to your graph.
  37. TL    move xleft xright xleft - .1 * + ybottom ytop ybottom - .9 * + 
  38. BL    move xleft xright xleft - .1 * + ybottom ytop ybottom - .1 * + 
  39. TR    move xleft xright xleft - .9 * + ybottom ytop ybottom - .9 * + 
  40. BR    move xleft xright xleft - .9 * + ybottom ytop ybottom - .1 * + 
  41. Center    move xleft xright 2 / ybottom ytop 2 / 
  42.  
  43. %---------------------------------------------------------------------------------
  44. % Helpful aliases.
  45. %---------------------------------------------------------------------------------
  46. % You can use command macros to define Asymptote commands to make them easier
  47. % for you to remember or more compatable with the commands in other graphics programs.
  48. lineto    drawto
  49. exit    quit